package com.weishi.project.api.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.util.*;

@Data
public class BodyFunctionAnalysisVo {
    @ApiParam(value = "体重")
    private double weight;
    @ApiParam(value = "血红蛋白")
    private double hb;
    @ApiParam(value = "血尿素氨")
    private double bu;
    @ApiParam(value = "肌酸激酶")
    private double ck;
    @ApiParam(value = "高血压")
    private double hbp;
    @ApiParam(value = "低血压")
    private double lbp;
    @ApiParam(value = "尿酸")
    private double ua;
    @ApiParam(value = "心率")
    private double hr;
    @ApiParam(value = "血清睾酮")
    private double st;
    @ApiParam(value = "血乳酸")
    private double bla;
    @ApiParam(value = "最大摄氧量")
    private double maxOxygen;
    @ApiParam(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date startTime;
    @ApiParam(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endTime;


    public static List<Map<String,Object>> getMap(BodyFunctionAnalysisVo vo){
        List<Map<String,Object>> list = new ArrayList<>();
        Map<String,Object> weight = new HashMap<>();
        weight.put("name","weight");
        weight.put("value",vo.getWeight());
        list.add(weight);
        Map<String,Object> hb = new HashMap<>();
        hb.put("name","hb");
        hb.put("value",vo.getHb());
        list.add(hb);
        Map<String,Object> bu = new HashMap<>();
        bu.put("name","bu");
        bu.put("value",vo.getBu());
        list.add(bu);
        Map<String,Object> ck = new HashMap<>();
        ck.put("name","ck");
        ck.put("value",vo.getCk());
        list.add(ck);
        Map<String,Object> hbp = new HashMap<>();
        hbp.put("name","hbp");
        hbp.put("value",vo.getHbp());
        list.add(hbp);
        Map<String,Object> lbp = new HashMap<>();
        lbp.put("name","lbp");
        lbp.put("value",vo.getLbp());
        list.add(lbp);
        Map<String,Object> ua = new HashMap<>();
        ua.put("name","ua");
        ua.put("value",vo.getUa());
        list.add(ua);
         Map<String,Object> hr = new HashMap<>();
        hr.put("name","hr");
        hr.put("value",vo.getHr());
        list.add(hr);
         Map<String,Object> st = new HashMap<>();
        st.put("name","st");
        st.put("value",vo.getSt());
        list.add(st);
        Map<String,Object> bla = new HashMap<>();
        bla.put("name","bla");
        bla.put("value",vo.getBla());
        list.add(bla);

        return list;
    }
}
